<?php

namespace App\Http\Controllers;

use App\Model\Article;
use App\Model\Cate;
use App\Model\Tag;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    //

    public function index()
    {
    	# code...
        $articles = Article::orderBy('created_at','desc')->limit(6)->get();
//        dd($articles);
        $cates = Cate::orderBy('created_at','desc')->get();

        $tags = Tag::orderBy('created_at','desc')->limit(4)->get();

    	return view('index.index',compact('articles','cates','tags'));
    }

}
